fix: resolve openai-compat provider fails when using IP:port base URL - #1090
Open
RerankerGuo wants to merge 1 commit into
Open
fix: resolve openai-compat provider fails when using IP:port base URL#1090RerankerGuo wants to merge 1 commit into
RerankerGuo wants to merge 1 commit into
Conversation
Closes agentscope-ai#1057 - Bug 1: Detect IP vs domain host and use static service source for IPs instead of DNS, preventing Envoy DNS cluster resolution failures - Bug 2: Strip port from openaiCustomUrl (scheme://host/path only) to avoid polluting the upstream Host header and host-domain matching - Bug 3: Implement GET→PUT if exists / POST if not idempotent updates for ensureServiceSource, ensureStaticServiceSource, and EnsureAIProvider so re-running the initializer correctly updates existing configs - Apply same fixes to setup-higress.sh shell script Test: gofmt -e (syntax check passed), bash -n (shell syntax OK)
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
RerankerGuo
force-pushed
the
fix/issue-1057-openai-compat-ip-port
branch
from
July 30, 2026 00:53
cb0be30 to
07982e2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes #1057 by resolving three bugs in the openai-compat provider setup when using IP:port base URLs.
Changes
Bug 1: IP address now uses static service source (not DNS)
net.ParseIP()detection in bothinitializer.goandsetup-higress.sh.dnsto.staticfor IP-based hostsBug 2: openaiCustomUrl no longer includes port
scheme://host/path(without port)openaiCustomServicePortBug 3: Idempotent GET→PUT updates for existing resources
ensureServiceSource,ensureStaticServiceSource, andEnsureAIProvidernow use GET→PUT if exists / POST if not patternAffected Files
agentteams-controller/internal/gateway/higress.go— GET→PUT pattern for service sources and AI providersagentteams-controller/internal/initializer/initializer.go— IP detection + port stripping for openai-compat and default provider pathsmanager/scripts/init/setup-higress.sh— Same fixes in shell scriptVerification
gofmt -esyntax check passed for Go filesbash -nsyntax check passed for shell script